package model.components;

public class ComponentDoor extends Component {

	public ComponentDoor(String pLabel, double pOpened) {
		super(pLabel, pOpened);		
	}

	/**
	 * @return the opened
	 */
	public boolean isOpened() {
		return getComponentState()==1?true:false;
	}

	/**
	 * @param pOpened
	 *            the opened to set
	 */
	public void setOpened(boolean pOpened) {
		setComponentState(pOpened?1:0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return super.toString() + " ComponentDoor [isOpened()=" + isOpened() + "]\n";
	}

}
